package com.example.sj.baseapplication.Base;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;


/**
 * Created by Administrator on 2017/11/3.
 */

public abstract class BaseActivity<B extends ViewDataBinding> extends AppCompatActivity {
    private B bingding;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        bingding= DataBindingUtil.setContentView(this,setLayout());
        init(bingding);
    }
    public abstract int setLayout();
    public abstract void init(B bingding);
    public void toast(Object s){
        Toast.makeText(this, String.valueOf(s), Toast.LENGTH_SHORT).show();
    }
}
